package com.twu.biblioteca;

/**
 * Created by csuarez on 03/02/14.
 */
public class Movie implements Borrowable {

    private String name;
    private String director;
    private String year;
    private String rate;
    private boolean availability;


    public Movie(String name, String director, String year, String rate) {
        this.name = name;
        this.director = director;
        this.year = year;
        this.rate = rate;
        this.availability = true;
    }


    public String getInformation() {
        return name + ", " + director + ", " + year + ", " + rate;
    }

    @Override
    public String getTitle() {
        return name;
    }

    @Override
    public void checkIn() {
        availability = true;
    }

    @Override
    public void checkOut() {
        availability = false;
    }

    @Override
    public BorrowableType getType() {
        return BorrowableType.MOVIE;
    }

    @Override
    public boolean canBeCheckedIn() {
        return availability == false;
    }

    @Override
    public boolean canBeCheckedOut() {
        return availability;
    }
}
